<template>
	<view class="padding-20">
		<view>
			<u-alert title="会员价为0时，使用默认价格。大于0时，商品实际价格=货品销售价-会员价" type="primary"></u-alert>
		</view>
		<view>
			<view class="flex align-center border-b padding-20" v-for="(item, index) in gradePrice" :key="index">
				<text class="mr-20">{{item.title}}</text>
				<u-input
					placeholder="请输入会员优惠"
					v-model="item.value"
					type="digit"
					border="none"
				></u-input>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {},
		data () {
			return {
				gradePrice:[
					{ key:0, value:0, title:'不定' },
					{ key:1023, value:0, title:'公主' },
					{ key:1024, value:0, title:'女王' },
					{ key:1025, value:0, title:'女神' },
				]
			}
		},
		created() {
			
		},
		watch: {
			gradePrice: {
				deep: true, // 深度监听，包括子对象的变化
				handler(newVal){
					this.$emit('update:gradePrice', newVal)
				}
			}
		},
	}
</script>

<style>
</style>